home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Demos / AppMaker 2.0b3 / Demo AppMaker 1.5 / Demo AppMaker™ / Demo AppMaker™.rsrc / TmPT_302_zApp < prev    next >
Encoding:
Text File  |  1992-04-08  |  3.0 KB  |  146 lines

  1. { %filename% -- application methods }
  2. { Created %date% %time% by AppMaker }
  3.  
  4. {    We recommend that you not modify this module and instead modify        }
  5. {    its subclass, %Appname%App.  The 'z' prefix on this module marks%    %}
  6. {    a module which is likely to be regenerated by AppMaker after you    }
  7. {    make changes to the user interface.  The modules without the 'z'    }
  8. {    prefix will not be regenerated by AppMaker unless you delete them.    }
  9. {    Using a separate subclass to override the AppMaker-generated code    }
  10. {    lets you regenerate code without losing your hand-coded changes.    } 
  11.  
  12. Unit %unitname%;
  13. Interface
  14.  
  15. Uses
  16.     TCL,
  17.     FW_Tearoffs,
  18.     AMCL,
  19.     %AppName%Intf,
  20.     %for each dialog gen usesModeless%
  21.     ResourceDefs;
  22.  
  23. {----------}
  24. Implementation
  25.  
  26. const
  27.     kExtraMasters        = 4;
  28.     kRainyDayFund        = 20480;
  29.     kCriticalBalance    = 20480;
  30.     kToolboxBalance        = 20480;
  31.  
  32. {----------}
  33. Procedure Z%Appname%App.I%Appname%App;
  34. Begin
  35.     IApplication (kExtraMasters, kRainyDayFund,
  36.                                     kCriticalBalance, kToolboxBalance);
  37.  
  38.     %for each dialog gen createModeless%
  39.  
  40. End; {I%Appname%App}
  41.  
  42. {----------}
  43. Procedure Z%Appname%App.MakeDesktop;
  44. var
  45.     fwDesktop:        CFWDesktop;
  46. Begin
  47.     New (fwDesktop);
  48.     fwDesktop.IFWDesktop (self);
  49.     gDesktop := fwDesktop;
  50.  
  51. End; {MakeDesktop}
  52.  
  53. {----------}
  54. Procedure Z%Appname%App.SetUpMenus;
  55. var
  56.     macMenu:        MenuHandle;
  57. Begin
  58.     inherited SetUpMenus;
  59.     %for each menu gen setup%
  60.  
  61.     %for each menu gen addPopup%
  62.  
  63. End; {SetUpMenus}
  64.  
  65. {----------}
  66. Procedure Z%Appname%App.CreateDocument;
  67. var
  68.     theDocument:%    %C%Appname%Doc;
  69.     fi:                FailInfo;
  70.  
  71.     {----------}
  72.     Procedure HandleFailure    (error:        Integer;
  73.                              message:    Longint);
  74.     Begin
  75.         ForgetObject (theDocument);
  76.     End;
  77.  
  78. Begin
  79.     theDocument := nil;
  80.     CatchFailures (fi, HandleFailure);
  81.  
  82.     New (theDocument);
  83.     theDocument.I%Appname%Doc (self, true);
  84.     theDocument.NewFile;
  85.  
  86.     Success;
  87. End; {CreateDocument}
  88.  
  89. {----------}
  90. Procedure Z%Appname%App.OpenDocument    (macSFReply:    SFReply);
  91. var
  92.     theDocument:%    %C%Appname%Doc;
  93.     fi:                FailInfo;
  94.  
  95.     {----------}
  96.     Procedure HandleFailure    (error:        Integer;
  97.                              message:    Longint);
  98.     Begin
  99.         ForgetObject (theDocument);
  100.     End;
  101.  
  102. Begin
  103.     theDocument := nil;
  104.     CatchFailures (fi, HandleFailure);
  105.  
  106.     New (theDocument);
  107.     theDocument.I%Appname%Doc (self, true);
  108.     theDocument.OpenFile (macSFReply);
  109.  
  110.     Success;
  111. End; {OpenDocument}
  112.  
  113. %if fileExists appname+App.p%
  114.     {----------}
  115.     { This code should be in %Appname%App.p rather than in this file. }
  116.     { AppMaker generated it here because %Appname%App.p already existed. }
  117.     { AppMaker doesn't overwrite an existing non-Z file because it }
  118.     { might have lots of user hand-written code. }
  119.     {----------}
  120.     Procedure Z%Appname%App.UpdateMenus;
  121.     Begin
  122.         inherited UpdateMenus;
  123.         %for each menu gen updateAppMenus%
  124.     
  125.     End; {UpdateMenus}
  126.  
  127. %endif%
  128. {----------}
  129. Procedure Z%Appname%App.DoCommand    (theCommand:    longint);
  130. var
  131.     itemNr:            integer;
  132. Begin
  133.     case theCommand of
  134.         cmdAbout:
  135.                 itemNr := Alert (1, nil);
  136.         %if fileExists appname+App.p%
  137.             %for each menu gen handleAppItems%
  138.         %endif%
  139.  
  140.         otherwise
  141.             inherited DoCommand (theCommand);
  142.     end; {case}
  143. End; {DoCommand}
  144.  
  145. End. {%unitname%}
  146.